<style type="text/css">
	body, td {font-size: 12px;font-family: arial,helvetica,sans-serif;}
	.itemtbl {margin-top:20px;}
	.itemtbl tr td {padding: 10px;color: #333;}
	tr.itemheading td{border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;}
	.padtoptwty {padding-top:20px !important;}
	tr.last td {border-bottom:none;}
	tr.itemrepeat td {border-bottom:1px dashed #ccc;}
	.itemtbl {margin-top:20px;}
	.itemtbl tr td {padding: 10px;color: #333;}	
	.content {margin-top: 30px;color:#333 !important; }
	.mainheading{color:#333333;font-weight:bold;}
	.confirm {color: #4c8f3a;}
	.greeting {color:#333333 !important;font-weight:bold;}
	.status {font-size:14px;color:#C88039;font-weight:bold;text-decoration:none;}	
	.strong {font-weight: bold;}
	.valign {vertical-align: middle;}
	.purchasebox {width: 598px;}
	.purchasetitle {border-bottom:1px solid #ccc;padding:5px 0 5px 10px;}
	.purchaseboxmul {border:1px solid #ccc;margin:10px 0 10px 0;padding-bottom:10px;}
	.purchasetotal {border-top: 1px solid #ccc;border-bottom: 1px solid #ccc;}
	.purchasetotal {margin: 7px 0 20px 0;}
	.purchasetotal tr td{padding-bottom:20px;}
	.purchasetotalmul {border-top: 1px solid #ccc;width : 580px;}
	.purchasetotalmul img , .purchasetotal img {margin-top: 20px;}
	.purchasedetails tr td{color:#333;padding-top:15px;}
	.purchasedetailsmul tr td{color:#333;padding:20px 0 0 10px;}

	.headinfo {color:#333333;}
	
	hr {color: #dedede !important;height:1px;}
	.totaltbl {margin-top: 20px;}
	.totaltbl tr td {text-align:right;color: #333;padding:0 5px 0 0;width: 90px;}
	.totaltblmlt {margin: 10px 0 0 10px;}
	.totaltblmlt tr td {text-align:right;color: #333;width: 85px;}
	.totaltblmlt tr td.subhd , .totaltbl tr td.subhd {width: 390px;padding-right: 10px;text-align:right;}
	.clr {clear:both;}
	.airtbl {margin-top : 30px;width:320px;}
	.emphasis {color:#333333 !important;font-weight:bold;}
	.padleftten {padding-left: 10px;}
	.option {color: #aaaaaa;}
	.fmf {color:red;}
	.airtbl tr td{padding-right: 15px;color: #757575;padding-bottom: 5px;}
	.tblfooter {color: #757575;padding-left:10px;}
	.help{margin-right: 5px;vertical-align: middle;}
	.footercontainer{width:400px;}
	.exchange{width:100%;}
							      
	/*For 26568 spec */
	.headerDetails {color:#000000 !important;font-weight:bold;}
	.description {color:#333333;}
	.topBorder{border-top:1px solid #CCCCCC;}
	.bottomBorder{border-bottom:1px solid #CCCCCC;}
	.bottomMargin{margin:7px 0 20px;}
	.redFmf{color:#ff0000;}
	.padBottom {padding-bottom:20px !important;}
	.contentNew {color:#666666;}
	HR.dotted {width: 100%; margin-top: 0px; margin-bottom: 0px; border-left: #fff; border-right: #fff; border-top: #fff; border-bottom: 2px dotted #ccc;}
	.useNextBox {
		background:#FFFFFF url(http://www.paypal.com/en_US/i/scr/scr_table_bg_1x70.gif) repeat-x scroll left bottom;
		border:1px solid #CCCCCC;
		border-collapse:separate;
		padding:10px 10 20px 10px;
		width:530px;
		margin-left:20px;
		margin-top:20px;
		color:#333333;
		font-family:arial,helvetica,sans-serif;
		font-size:11px;
	}
	.boxHead{width:530px;padding-bottom:10px !important;border-bottom:1px solid #CCCCCC;text-align:left;}
	.boxHeadingTxt{font-size:12px;font-weight:bold;}
	.padBoxTop {padding-top:10px !important;}
	.SignupLink{color:#084482 !important;}
	
	.product-view-price { text-decoration: none; font-size: 15px; font-weight: bold; color: #ea0000 }
	.product-view-currency { color: #678db4} 
	.product-view-price-discount { text-decoration: line-through; }
	.color-white { color: #ffffff;}
	.total-cart { border-top: solid 2px #aaaaaa; }

</style>

<table align="center" border="0" cellpadding="0" cellspacing="0" width="800">
	<tr>
		<td>&nbsp;</td>
	</tr>
</table>
<table align="center" border="0" cellpadding="0" cellspacing="0" width="800">
	<tr valign="top">
		<td width="100%">
			<table align="center" border="0" cellpadding="0" cellspacing="0" style="color:#333333 !important;font-family: arial,helvetica,sans-serif;font-size:12px;" width="800">
				<tr valign="top">
					<td>
						<h1 style="margin-top: 30px;color:#ff0000 !important;font-weight:bold;font-family: arial,helvetica,sans-serif;font-size:22px;">
							<?php echo __d('store','Order ID:',true)?> <?php echo $order_id?>
						</h1>
					</td>
					<td align="right" valign="middle">
						<?php echo __d('store','Date',true)?> <?php echo date('Y-m-d H:i:s')?><br/>
						<?php echo $_SERVER['HTTP_HOST']?>
					</td>
				</tr>
			</table>
			<div style="margin-top: 30px;color:#333 !important;font-family: arial,helvetica,sans-serif;font-size:12px;">
	
				<div style="margin-top:5px;">
					<hr size="1"/>
				</div>
				<table align="left" border="0" cellpadding="0" cellspacing="0" style="color:#666666 !important;font-family: arial,helvetica,sans-serif;font-size:11px;" width="98%">
					<tr>
						<?php $col = ($customer['delivery_as_billing'])?50:30;?>
						<td align="left" style="padding-top:15px;" valign="top" width="<?php echo $col?>%">
							<span style="color:#333333;font-weight:bold;">
								<?php echo __d("store","Seller",true)?>
							</span>
							<br/><?php echo (!empty($sprzedawca['Employee'][0]['company']))? $sprzedawca['Employee'][0]['company'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['Employee'][0]['name']) || !empty($sprzedawca['Employee'][0]['surname']))? $sprzedawca['Employee'][0]['name']." ".$sprzedawca['Employee'][0]['surname'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['Employee'][0]['address1']))? $sprzedawca['Employee'][0]['address1'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['Employee'][0]['address2']))? $sprzedawca['Employee'][0]['address2'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['Employee'][0]['address3']))? $sprzedawca['Employee'][0]['address3'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['Employee'][0]['address4']))? $sprzedawca['Employee'][0]['address4'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['User']['eamil']))? $sprzedawca['User']['email'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['Employee'][0]['phone1']))? $sprzedawca['Employee'][0]['phone1'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['Employee'][0]['phone2']))? $sprzedawca['Employee'][0]['phone2'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['Employee'][0]['phone3']))? $sprzedawca['Employee'][0]['phone3'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['Employee'][0]['phone4']))? $sprzedawca['Employee'][0]['phone4'].'<br/>' : '';?>
							<?php echo (!empty($sprzedawca['Employee'][0]['bank_account']))? __d("store","Bank Account: ").$sprzedawca['Employee'][0]['bank_account'] : '';?>
						</td>
						<td style="padding-top:15px;" valign="top">
							<span style="color:#333333;font-weight:bold;">
								<?php echo __d("store","Buyer",true)?>
							</span>
							<br/><?php echo (!empty($customer['company']))? $customer['company'].'<br/>' : '';?>
							<?php echo (!empty($customer['name']) || !empty($customer['surname']))? $customer['name']." ".$customer['surname'].'<br/>' : '';?>
							<?php echo (!empty($customer['address1']))? $customer['address1'].'<br/>' : '';?>
							<?php echo (!empty($customer['address2']))? $customer['address2'].'<br/>' : '';?>
							<?php echo (!empty($customer['address3']))? $customer['address3'].'<br/>' : '';?>
							<?php echo (!empty($customer['address4']))? $customer['address4'].'<br/>' : '';?>
							<?php echo (!empty($customer['address5']))? $customer['address5'].'<br/>' : '';?>
							<?php echo $this->Session->read('Auth.User.email').'<br/>';?>
							<?php echo (!empty($customer['phone1']))? $customer['phone1'].'<br/>' : '';?>
							<?php echo (!empty($customer['phone2']))? $customer['phone2'].'<br/>' : '';?>
							<?php echo (!empty($customer['phone3']))? $customer['phone3'].'<br/>' : '';?>
							<?php echo (!empty($customer['phone4']))? $customer['phone4'].'<br/>' : '';?>
							<?php echo (!empty($customer['bank_account']))? __d("store","Bank Account: ").$customer['bank_account'] : '';?>
						</td>
						<?php if(!$customer['delivery_as_billing']){?>
						<td style="padding-top:15px;" valign="top">
							<span style="color:#333333;font-weight:bold;">
								<?php echo __d("store","Delivery Address",true)?>
							</span>
							<br/>
							<?php echo (!empty($customer['delivery_name']) || !empty($customer['delivery_surname']))? $customer['delivery_name']." ".$customer['delivery_surname'].'<br/>' : '';?>
							<?php echo (!empty($customer['delivery_address1']))? $customer['delivery_address1'].'<br/>' : '';?>
							<?php echo (!empty($customer['delivery_address2']))? $customer['delivery_address2'].'<br/>' : '';?>
							<?php echo (!empty($customer['delivery_address3']))? $customer['delivery_address3'].'<br/>' : '';?>
							<?php echo (!empty($customer['delivery_address4']))? $customer['delivery_address4'].'<br/>' : '';?>
							<?php echo (!empty($customer['delivery_address5']))? $customer['delivery_address5'].'<br/>' : '';?>
						</td>
						<?php }?>
					</tr>
					<tr>
						<td align="left" style="padding-top:15px;" valign="top" width="40%"/>
						<td style="padding-top:15px;" valign="top"/>
					</tr>
				</table>
				<table align="center" border="0" cellpadding="0" cellspacing="0" style="clear:both;color:#666666 !important;font-family: arial,helvetica,sans-serif;font-size:11px;margin-top:20px;" width="800">
					<tr>
						<td align="left" style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width="350">
							<?php echo __d("store","Name",true)?>
						</td>

						<td colspan="2" align="left" style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width="200">
							<?php echo __d("store","Quantity",true)?>
						</td>
						
						<td align="right" style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width="100">
							<?php echo __d("store","Price",true)?>
						</td>
												
						<td align="right" style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;" width="100">
							<?php echo __d("store","Value",true)?>
						</td>
					</tr>



					<?php if(isset($items) && is_array($items)){
					
					$i=0;
					$sum = 0.00;
					$ilosc_typow = 0;
					$style_class = null;
					
					foreach ($items as $item):
						$style_class = null;
						if ($i++ % 2 == 0) {
							$style_class = ' class="altrow"';
						}
						$ilosc_typow = $item['StoreProduct']['amount'];
					?>
						<tr>

							<td width="25%"  align="left" style="padding: 10px;">
								<?php echo $this->Html->link($item['StoreProduct']['name'], $this->Html->url(array('plugin'=>'store','controller'=>'products','action' => 'view', $item['StoreProduct']['id']), true),array('escape'=>false)); ?><br/>
							</td>	
							<td width="3%" valign="middle">
								<?php echo $item['StoreProduct']['amount']; ?>	
							</td>
							<td width="27%"  align="left" style="padding: 10px;">
									<table  border="0" cellpadding="0" cellspacing="0" width="100%" >
										<?php foreach ($item['StoreType'] as $type) {?>
										<tr>
											<td>
											<?php echo $type['name'];?>
											</td>
											<td>
											 <?php echo (!empty($type['group'])) ? $type['group'] : '';?>
											</td>									
										</tr>	
										<?php }	?>	
									</table>
							</td>
							<td  width="20%" align="right" style="padding: 10px;">
								<?php if($item['StoreProduct']['price_przecena'] > 0 && $item['StoreProduct']['price_promocja'] == 0){?>
										<span class="product-view-price-discount"><?php echo $this->Store->price($item['StoreProduct']['price_detaliczna'],2,'','',$item['StoreProduct']['currency_id'],$item['StoreCurrency']['exchange']);?></span> 
										<span class="product-view-price"><?php echo $this->Store->price($item['StoreProduct']['price_przecena'],2,null,null,$item['StoreProduct']['currency_id'],$item['StoreCurrency']['exchange'])?></span>
								<?php }else if( $item['StoreProduct']['price_promocja'] > 0){?>
										<span class="product-view-price-discount"><?php echo $this->Store->price($item['StoreProduct']['price_detaliczna'],2,'','',$item['StoreProduct']['currency_id'],$item['StoreCurrency']['exchange']);?></span> 
										<span class="product-view-price"><?php echo $this->Store->price($item['StoreProduct']['price_promocja'],2,null,null,$item['StoreProduct']['currency_id'],$item['StoreCurrency']['exchange'])?></span>
								<?php }else{?>
										<span class="product-view-price"><?php echo $this->Store->price($item['StoreProduct']['price_detaliczna'],2,null,null,$item['StoreProduct']['currency_id'],$item['StoreCurrency']['exchange'])?></span>
								<?php }?>
							</td>
							<td  width="20%" align="right" style="padding: 10px;">
								<?php if($item['StoreProduct']['price_przecena'] > 0 && $item['StoreProduct']['price_promocja'] == 0){?>
										<?php
											$price = str_replace(',', '.', $item['StoreProduct']['price_przecena']) * $ilosc_typow;	
											$price_detal = str_replace(',', '.', $item['StoreProduct']['price_detaliczna'])*$ilosc_typow;								
											$sum += $price;
										?>
										<span class="product-view-price-discount"><?php echo $this->Store->price($price_detal,2,'','',$item['StoreProduct']['currency_id'],$item['StoreCurrency']['exchange']);?></span> 
										<span class="product-view-price"><?php echo $this->Store->price($price,2,null,null,$item['StoreProduct']['currency_id'],$item['StoreCurrency']['exchange'])?></span>
										 
								<?php }else if( $item['StoreProduct']['price_promocja'] > 0){?>
										<?php
											$price = str_replace(',', '.', $item['StoreProduct']['price_promocja']) * $ilosc_typow;	
											$price_detal = str_replace(',', '.', $item['StoreProduct']['price_detaliczna'])*$ilosc_typow;								
											$sum += $price;
										?>
										<span class="product-view-price-discount"><?php echo $this->Store->price($price_detal,2,'','',$item['StoreProduct']['currency_id'],$item['StoreCurrency']['exchange']);?></span> 
										<span class="product-view-price"><?php echo $this->Store->price($price,2,null,null,$item['StoreProduct']['currency_id'],$item['StoreCurrency']['exchange'])?></span>
				
								<?php }else{?>
										<?php
											$price = str_replace(',', '.', $item['StoreProduct']['price_detaliczna']) * $ilosc_typow;									
											$sum += $price;
										?>
										<span class="product-view-price"><?php echo $this->Store->price($price,2,null,null,$item['StoreProduct']['currency_id'],$item['StoreCurrency']['exchange'])?></span>
		
								<?php }?>
							</td>
						</tr>
					<?php endforeach; ?>
					<?php }?>
	
	
					<?php
					if(isset($delivery) && is_array($delivery) && !empty($delivery)){?>
					<tr>
						<td colspan="5" align="right" width="100%" class="actions total-cart" style="border:1px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;">		
							<?php 
								echo __d("store","Delivery costs: ( ").$delivery['name']?> ) <span class="product-view-price"><?php echo $this->Store->price($delivery['price'],2,null,null,$delivery['currency_id'],$delivery['exchange'])?></span>
								<?php $sum += $delivery['price']; ?>
						</td>
					</tr>
					<?php }?>
					<tr>
						<td colspan="5" align="right" width="100%" class="actions total-cart" style="border:2px solid #ccc;border-right:none;border-left:none;padding:5px 10px 5px 10px !important;color: #333333 !important;">
						
							<?php echo __d("store","Total: ")?><span class="product-view-price"><?php echo $this->Store->price($sum,2,null,null,$this->Session->read('Store.selected_currency'),$this->Session->read('Store.selected_exchange'))?></span>
						</td>
					</tr>
				</table>
				<br/><br/><br/> 				
				<span style="font-size:11px;color:#333;">
					<?php echo $order['StoreOrder']['order_nout']?><br/>
					<br/>
					<strong><?php echo __d("store","Best regards",true)?></strong>					
				</span>
			</div>
			<br/>
			<hr/>
			<span class="xptFooter">
				<?php echo sprintf(__d('store','Copyright '.Date('Y').' %s. All rights reserved.', true),$_SERVER['HTTP_HOST'] )?><br/><br/>
			</span>		
		</td>
	</tr>
</table>